package com.sneakxy.cloudbase.platform.service;

import java.util.List;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.sneakxy.cloudbase.platform.bean.dto.MenuDTO;
import com.sneakxy.cloudbase.platform.bean.dto.MenuTreeDTO;
import com.sneakxy.cloudbase.platform.utils.web.Response;

@FeignClient(name="security-producer", path = "/security/api/menu")
public interface MenuClient {

	@PostMapping("tree")
	public Response<MenuTreeDTO> tree(
			@RequestParam(name="type")
			String type);
	
	@PostMapping("add")
	public Response<MenuDTO> add(@SpringQueryMap MenuDTO menu);
	
	@PostMapping("edit")
	public Response<MenuDTO> edit(@SpringQueryMap MenuDTO menu);
	
	@PostMapping("enable")
	public Response<String> enable(
			@RequestParam(name="id")
			String id,
			@RequestParam(name="enable")
			boolean enable);
	
	@PostMapping("remove")
	public Response<String> remove(@RequestParam(name="id") String id);
	
	@PostMapping("menus")
	public Response<List<MenuDTO>> menus(@RequestParam(name="type") String type);
	
	@PostMapping("one")
	public Response<MenuDTO> one(
			@RequestParam(name="id")
			String id);
	
}
